home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / compiler / Prim_opc.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  1.3 KB  |  54 lines  |  [TEXT/R*ch]

  1. (* Opcodes for the simple primitives. *)
  2.  
  3. local open Fnlib Prim Opcodes in
  4.  
  5. val opcode_for_primitive = fn
  6.     Pupdate => UPDATE
  7.   | Praise => RAISE
  8.   | Pnot => BOOLNOT
  9.   | Ptag_of => TAGOF
  10.   | Paddint => ADDINT
  11.   | Psubint => SUBINT
  12.   | Pmulint => MULINT
  13.   | Pdivint => DIVINT
  14.   | Pmodint => MODINT
  15.   | Pandint => ANDINT
  16.   | Porint => ORINT
  17.   | Pxorint => XORINT
  18.   | Pshiftleftint => SHIFTLEFTINT
  19.   | Pshiftrightintsigned => SHIFTRIGHTINTSIGNED
  20.   | Pshiftrightintunsigned => SHIFTRIGHTINTUNSIGNED
  21.   | Pintoffloat => INTOFFLOAT
  22.   | Pstringlength => STRINGLENGTH
  23.   | Pgetstringchar => GETSTRINGCHAR
  24.   | Psetstringchar => SETSTRINGCHAR
  25.   | Pmakevector => MAKEVECTOR
  26.   | Pvectlength => VECTLENGTH
  27.   | Pgetvectitem => GETVECTITEM
  28.   | Psetvectitem => SETVECTITEM
  29.   | Psmlnegint => SMLNEGINT
  30.   | Psmlsuccint => SMLSUCCINT
  31.   | Psmlpredint => SMLPREDINT
  32.   | Psmladdint => SMLADDINT
  33.   | Psmlsubint => SMLSUBINT
  34.   | Psmlmulint => SMLMULINT
  35.   | Psmldivint => SMLDIVINT
  36.   | Psmlmodint => SMLMODINT
  37.   | Pmakerefvector => MAKEREFVECTOR
  38.   | Psmlquotint => SMLQUOTINT
  39.   | Psmlremint   => SMLREMINT
  40.   | Pswap => SWAP
  41.   | _ => fatalError "opcode_for_primitive"
  42. ;
  43.  
  44. val opcode_for_float_primitive = fn
  45.     Pfloatofint => FLOATOFINT
  46.   | Psmlnegfloat => SMLNEGFLOAT
  47.   | Psmladdfloat => SMLADDFLOAT
  48.   | Psmlsubfloat => SMLSUBFLOAT
  49.   | Psmlmulfloat => SMLMULFLOAT
  50.   | Psmldivfloat => SMLDIVFLOAT
  51. ;
  52.  
  53. end;
  54.